<%#include "menusGroup.h" %>
<%
QString lang = httpRequest().cookie("lang");
QVariantMap qMap = httpRequest().queryItems();
QString tid = tId();

QString action = qMap.contains("action") ? httpRequest().queryItemValue("action"): variant("action").toString();
QString menusGroupId = qMap.contains("menusGroupId") ? httpRequest().queryItemValue("menusGroupId"): variant("menusGroupId").toString();
MenusGroup menusGroup = MenusGroup::get(hmacVal(menusGroupId).toInt());

QVariantMap qMapOut;
qMapOut.insert("menusGroupId",menusGroupId);
qMapOut.insert("action",action);
%>
<% if (action == "show"){ %>
<!-- show -->
<div id="formMenusGroup<%== tid %>" name="formMenusGroup" class="form" >
  <table class="layout-fixed" width="100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUSGROUPCD") %>:</td>
      <td><span style="padding-right:30px;" ><%== menusGroup.menusGroupCd() %></span>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUSGROUPNAMEZH") %>:</td>
      <td><span style="padding-right:30px;" ><%== menusGroup.menusGroupNameZh() %></span>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUSGROUPNAMEEN") %>:</td>
      <td><span style="padding-right:30px;" ><%== menusGroup.menusGroupNameEn() %></span>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUSGROUPTOOLTIP") %>:</td>
      <td colspan="5"><span style="padding-right:15px;"><%== menusGroup.menusGroupTooltip() %></span></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUSGROUPDESC") %>:</td>
      <td colspan="5"><span style="padding-right:15px;"><%== menusGroup.menusGroupDesc() %></span></td>
   </tr>
  </table>
</div>
<% }else { %>
<!-- edit -->
<div id="formMenusGroup<%== tid %>" name="formMenusGroup" class="form" action="/SystemUIsetting/<%== action %>MenusGroup">
  <%== inputAuthenticityTag() %>
  <% if (action != "create") { %>
     <input name="menusGroupId" class="mini-textbox" visible="false" value="<%== menusGroupId %>"  /> 
  <% } %>
  <table style="width:100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("MENUSGROUPCD") %></b>:</td>
      <td><input name="menusGroupCd" class="mini-textbox" vtype="maxLength:16" style="width:100%" value="<%== menusGroup.menusGroupCd() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("MENUSGROUPNAMEZH") %></b>:</td>
      <td><input name="menusGroupNameZh" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== menusGroup.menusGroupNameZh() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("MENUSGROUPNAMEEN") %></b>:</td>
      <td><input name="menusGroupNameEn" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== menusGroup.menusGroupNameEn() %>" /></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUSGROUPTOOLTIP") %>:</td>
      <td colspan="5"><input name="menusGroupTooltip" class="mini-textarea" vtype="maxLength:256" style="width:100%" value="<%== menusGroup.menusGroupTooltip() %>" /></td>
    </tr>
    <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUSGROUPDESC") %>:</td>
      <td colspan="5"><input name="menusGroupDesc" class="mini-textarea" style="width:100%" value="<%== menusGroup.menusGroupDesc() %>" /></td>
    </tr>
  </table>
</div>
<% } %>
<!-- toolBar -->
<div class="mini-toolbar" style="border:0px">
    <% if (action == "show" && accessAllow("SystemUIsetting","editMenusGroup")){ %>
        <a class="mini-button" onclick="editForm('formMenusGroup<%== tid %>','/PartialService/formMenusGroup?action=edit&menusGroupId=<%== menusGroupId%>')" tooltip="<%== UI("TP_SYSTEMUISETTING_EDIT_MENUSGROUP") %>" ><%== UI("Edit") %></a>
    <% } %>
</div>
<!-- tabs -->
<div class="mini-fit">
    <% if (action != "create") { %>
    <%== renderPartial("SystemUIsetting/relationOfMenusGroup",qMapOut) %> 
    <% } %>
</div>